home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 2 / CU Amiga Magazine's Super CD-ROM 02 (1996)(EMAP Images)(GB)[!][issue 1996-04].iso / magazine / amiga_e / e_v3.2a_extras / pdsrc / floodwindow.e < prev    next >
Text File  |  1992-09-02  |  3KB  |  81 lines

  1. /*
  2.     floodwindow.e
  3.  
  4.     A PROC which will flood inside the borders of any window in any colour
  5.     plus wrapper code showing how it works
  6.  
  7.     IMPORTANT NOTE:     If you want to know title bar height _before_ you
  8.                         open your window, eg, for font awareness, you should
  9.                         use
  10.                         DEF              screen:PTR TO screen,
  11.                                          font:PTR TO textattr
  12.                         screenfont:=     screen.font
  13.                         titlebarheight:= screen.wbortop+font.ysize+1
  14.  
  15.     When    Who     What
  16.     ------- ------- ---------------------------------------------------------
  17.     4/3/94  UWP!    All of it!
  18.  
  19. */
  20.  
  21. MODULE  'intuition/screens','exec/lists','exec/nodes',
  22.         'intuition/intuition',
  23.         'intuition/screens','intuition/gadgetclass','graphics/text'
  24.  
  25. PROC    main()
  26. DEF     screen:PTR TO screen, window:PTR TO window,class,
  27.         imess:PTR TO intuimessage, quit
  28.  
  29.     screen:=(LockPubScreen(NIL))   /* no testing, I assume you have WB :) */
  30.     window:=OpenWindowTagList(NIL,[ WA_TOP,         screen.height/2,
  31.                                     WA_LEFT,        screen.width/2,
  32.                                     WA_INNERWIDTH,  screen.width/4,
  33.                                     WA_INNERHEIGHT, screen.height/2,
  34.                                     WA_CLOSEGADGET, TRUE,
  35.                                     WA_DRAGBAR,     TRUE,
  36.                                     WA_DEPTHGADGET, TRUE,
  37.                                     WA_SIZEBBOTTOM, TRUE, /* toggle this */
  38.                                     WA_SIZEGADGET,  TRUE,
  39.                                     WA_MINHEIGHT,   100,
  40.                                     WA_MINWIDTH,    50,
  41.                                     WA_MAXHEIGHT,   -1,
  42.                                     WA_MAXWIDTH,    -1,
  43.                                     WA_IDCMP,       IDCMP_CLOSEWINDOW OR
  44.                                                     IDCMP_CHANGEWINDOW,
  45.                                     WA_TITLE,       'Use me! Abuse me!',
  46.                                     0,0]) /* NB: no checking here either :<*/
  47.  
  48.     floodwindow(window,3)
  49.  
  50.     quit:=FALSE
  51.     WHILE quit=FALSE
  52.         class:=NIL
  53.         IF  imess:=GetMsg(window.userport)
  54.             class:=imess.class
  55.             IF  class=IDCMP_CHANGEWINDOW
  56.                 floodwindow(window,3)
  57.             ENDIF
  58.             IF  class=IDCMP_CLOSEWINDOW
  59.                 quit:=TRUE
  60.             ENDIF
  61.             ReplyMsg(imess)
  62.         ELSE
  63.             WaitPort(window.userport)
  64.         ENDIF
  65.     ENDWHILE
  66.  
  67.     CloseWindow(window)
  68.     UnlockPubScreen(NIL,screen)
  69.  
  70. ENDPROC
  71.  
  72. PROC    floodwindow(window:PTR TO window,colour)
  73.  
  74.     SetAPen(window.rport,colour)
  75.     RectFill(window.rport,  window.borderleft,
  76.                             window.bordertop,
  77.                             window.width-window.borderright-1,
  78.                             window.height-window.borderbottom-1)
  79.  
  80. ENDPROC
  81.